import re

lange = 'PythonC#JavaPhpC#'


def conver(value):
    print(value)
    return '!!'


r = re.sub('C#', conver, lange)

print(r)
